import UIKit
import SnapKit

class DrapImageCardView: UIView {
    let imageView = UIImageView()
    public var wordItem:DrapWordItem?
    
    override init(frame: CGRect) { super.init(frame: frame); setup() }
    required init?(coder: NSCoder) { super.init(coder: coder); setup() }
    private func setup() {
        backgroundColor = .black
        layer.cornerRadius = 10
        clipsToBounds = true
        imageView.contentMode = .scaleAspectFit
        addSubview(imageView)
        imageView.snp.makeConstraints { make in make.edges.equalToSuperview() }
    }
    
    func update(item: DrapWordItem) {
        wordItem = item
        imageView.image = GameManager.share.getImageBy(item.imgName)
        
    }
    
}
